﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Runtime.Serialization;
using System.ServiceModel;
namespace K.EnterpriseLibary
{
    [Serializable]
    public class KException : System.ServiceModel.FaultException<ExceptionInfo>
    {
        public KException()
            : base(new ExceptionInfo())
        { 
        
        }

        public KException(ExceptionInfo exceptionInfo)
            : base(exceptionInfo)
        { 
            
        }

        public KException(ExceptionInfo detail, FaultReason reason)
            : base(detail, reason)
        { 
        
        }

        public KException(ExceptionInfo detail, string reason)
            : base(detail, reason)
        {
 
        }

        public KException(ExceptionInfo detail, FaultReason reason, FaultCode code)
            : base(detail,reason,code)
        { 
            
        }

        public KException(ExceptionInfo detail, string reason, FaultCode code)
            : base(detail, reason, code)
        { 
        
        }

        public KException(ExceptionInfo detail, string reason, FaultCode code, string action)
            : base(detail, reason, code, action)
        { 
        
        }

        public KException(string message, params object[] extendParameters)
            : base(new ExceptionInfo(message, extendParameters.ObjectListToSortedList<string, object>()), message)
        { 
        
        }

        public KException(Exception innerException, string message, params object[] extendParameters)
            :base(new ExceptionInfo(message,extendParameters.ObjectListToSortedList<string,object>(),innerException),message)
        {
        
        }

        protected KException(SerializationInfo info, StreamingContext context)
            :base(info,context)
        {
        
        }
    }
}
